provider "alicloud" {
  profile = "default"
  version = "1.151.0"
}

locals {
  bucket = "bucket-app-website"
  acl    = "public-read"

  tags = {
    app = "ebike"
    tenant = "bolan"
    env    = "prod"
  }

}

resource "alicloud_oss_bucket" "bucket-website" {
  bucket = local.bucket
  acl    = local.acl

  website {
    index_document = "index.html"
    error_document = "error.html"
  }

  tags = local.tags
}

resource "null_resource" "main" {
  provisioner "local-exec" {
    command = <<EOF
        echo ${var.access_key} >> private_ips.txt
    EOF
  }
}